﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Churchtoolkit.Utils.ErrorProvider;
using Churchtoolkit.Web.Shell.Presenters;
using Churchtoolkit.Web.Shell.Views;
using System.Xml.Linq;
using System.Configuration;
using System.IO;
using System.Text;
using System.Drawing;
using System.Threading;
using Churchtoolkit.Utils.Navigation;

namespace Churchtoolkit.Web
{
    public partial class ForgetPassword : Page<ForgetPasswordPresenter>, IForgetPasswordView
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.vldrequiredEmail.Replace("[Field]", "Email");
            }
        }
        protected void Available_Email(object sender, ServerValidateEventArgs e)
        {
            e.IsValid = this.Presenter.AvailableMail(txtEmail.Text);
        }

        protected void btnForgetPassword_Click(object sender, EventArgs e)
        {
            if (this.IsValid)
            {
                this.Presenter.SendPasswordMail();
                Navigator.NavigateTo(Pages.Shared_Message);
            }
        }
    }
}